package com.swt.pojo;

/**
 * 条件抽象类
 * 
 * @author ZPF
 *
 */
public class Criteria {

	/**
	 * 排序规则
	 */
	protected String orderByColumn;

	/**
	 * 分组规则
	 */
	protected String groupByColumn;

	/**
	 * 是否去重
	 */
	protected Boolean distinct;

	/**
	 * 分页参数
	 * page: 页码
	 * start: 数据起始位置
	 * rows: 分页条数
	 */
	protected Integer page;
	
	protected Integer start;

	protected Integer rows;

	public String getOrderByColumn() {
		return orderByColumn;
	}

	public void setOrderByColumn(String orderByColumn) {
		this.orderByColumn = orderByColumn;
	}

	public String getGroupByColumn() {
		return groupByColumn;
	}

	public void setGroupByColumn(String groupByColumn) {
		this.groupByColumn = groupByColumn;
	}

	public Boolean getDistinct() {
		return distinct;
	}

	public void setDistinct(Boolean distinct) {
		this.distinct = distinct;
	}

	public Integer getPage() {
		return page;
	}

	public void setPage(Integer page) {
		this.page = page;
	}

	public Integer getStart() {
		return start;
	}

	public void setStart(Integer start) {
		this.start = start;
	}

	public Integer getRows() {
		return rows;
	}

	public void setRows(Integer rows) {
		this.rows = rows;
		if(this.page != null){
			this.start = (this.page - 1) * this.rows;
		}
	}

}
